/**
 * @projectName leetode
 * @package cn.leetcode
 * @className cn.leetcode.t701
 * @copyright Copyright 2020 Thunisoft, Inc All rights reserved.
 */
package cn.leetcode;

/**
 * t701
 * @description
 * @author fei
 * @date 2025/9/12 17:35
 * @version 1.0
 */
public class t701 {
    public TreeNode insertIntoBST(TreeNode root, int val) {
        if (root == null){
            return new TreeNode(val);
        }
        if (root.val< val){
            root.right = insertIntoBST(root.right, val);
        }
        if (root.val> val){
            root.left = insertIntoBST(root.left, val);
        }
        return root;
    }
}
